package cn.lili.modules.payment.client;

import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.payment.entity.dos.Recharge;
import cn.lili.modules.payment.entity.dto.PaymentCallback;
import cn.lili.modules.payment.fallback.RechargeFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 充值client
 *
 * @author liushuai(liushuai711 @ gmail.com)
 * @since 2021/12/7 08:22
 */
@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.PAYMENT_SERVICE, contextId = "recharge", fallback =
        RechargeFallback.class)
public interface RechargeClient {

    @PostMapping("/feign/recharge/auto-cancel")
    void autoCancel();


    /**
     * 交易支付
     *
     * @param paymentCallback 支付回调
     */
    @PostMapping("/feign/recharge/paymentCallback")
    void paymentCallback(@RequestBody PaymentCallback paymentCallback);
}
